package jin.chen.controller;

import jin.chen.pojo.Stu;
import jin.chen.service.StuService;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@RestController
public class StuController {

    @Autowired
    private StuService stuService;
    @RequestMapping(value = "/getStu", method = RequestMethod.GET)
    public Object selectById(Integer id){

        return stuService.getId(id);
    }

    @RequestMapping(value = "/insert", method = RequestMethod.POST)
    public Object insertStu(@RequestBody Stu stu){
//        Stu stu = new Stu();
//        stu.setName(name);
//        stu.setAge(age);
        return stuService.insertStu(stu);
    }

    @RequestMapping(value = "/delete", method = RequestMethod.GET)
    public Object deleteById( Integer id){
        return stuService.deleteById(id);
    }

}
